package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1HierarchInstance;
import com.lineage.server.model.Instance.L1PcInstance;

public class S_HierarchPack extends ServerBasePacket {
  private static final String _S__1F_HIERARCHPACK = "[S] S_HierarchPack";
  
  private byte[] _byte;
  
  public S_HierarchPack(L1HierarchInstance pet, L1PcInstance player) {
    this._byte = null;
    writeC(87);
    writeH(pet.getX());
    writeH(pet.getY());
    writeD(pet.getId());
    writeH(pet.getGfxId());
    writeC(pet.getStatus());
    writeC(pet.getHeading());
    writeC(pet.getLightSize());
    writeC(1);
    writeD(0);
    writeH(0);
    writeS(pet.getNameId());
    writeS(pet.getTitle());
    writeC(0);
    writeD(0);
    writeS(null);
    writeS((pet.getMaster() != null) ? pet.getMaster().getName() : "");
    writeC(0);
    writeC(255);
    writeC(0);
    writeC(pet.getLevel());
    writeC(0);
    writeC(255);
    writeC(255);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = this._bao.toByteArray(); 
    return this._byte;
  }
  
  public String getType() {
    return "[S] S_HierarchPack";
  }
}
